package com.hzyl.famousreader.view.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.BarUtils;
import com.blankj.utilcode.util.SPUtils;
import com.umeng.analytics.MobclickAgent;
import com.hzyl.famousreader.Constant;
import com.hzyl.famousreader.R;
import com.hzyl.famousreader.ThemeColor;
import com.hzyl.famousreader.databinding.*;

/**
 * 关于
 */
@Route(path = "/user/about")
public class AboutActivity extends AppCompatActivity {

  private ActivityAboutBinding binding;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    binding = DataBindingUtil.setContentView(AboutActivity.this, R.layout.activity_about);

    int colorValue = SPUtils.getInstance().getInt(Constant.SP_THEME_COLOR, ThemeColor.DEFAULT.getColor());
    BarUtils.setStatusBarColor(this, colorValue, 0);
    binding.toolbar.setBackgroundColor(colorValue);

    binding.version.setText(AppUtils.getAppVersionName());
  }

  @Override
  protected void onPause() {
    super.onPause();
    MobclickAgent.onPageEnd("关于页");
    MobclickAgent.onPause(this);
  }

  @Override
  protected void onResume() {
    super.onResume();
    MobclickAgent.onPageStart("关于页");
    MobclickAgent.onResume(this);
  }
}
